package com.example.math_exam.MVC;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.math_exam.R;
import com.example.math_exam.ShopEntitiy;

public class EnterAdapter extends BaseQuickAdapter<ShopEntitiy, BaseViewHolder> {

    public EnterAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, ShopEntitiy item) {

        /**
         *          private ImageView mItemEnterIcon;
         *         private TextView mItemEnterName;
         *         private TextView mItemEnterPrice;
         *         private TextView mItemEnterNum;
         *
         */

        helper.setImageResource(R.id.item_enter_icon, item.getIcon());
        helper.setText( R.id.item_enter_name, item.getName());
        helper.setText( R.id.item_enter_num, item.getNum() + "");
        helper.setText( R.id.item_enter_price, "￥" + item.getNum() * item.getPrice());

    }
}
